home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / Ang261Lib.lha / src / player.c < prev    next >
C/C++ Source or Header  |  1994-10-22  |  28KB  |  892 lines

  1. /* player.c: player specific variable definitions
  2.  
  3.    Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
  4.  
  5.    This software may be copied and distributed for educational, research, and
  6.    not for profit purposes provided that this copyright and statement are
  7.    included in all such copies. */
  8.  
  9. #include "constant.h"
  10. #include "config.h"
  11. #include "types.h"
  12.  
  13. /* Player record for most player related info */
  14. player_type py;
  15. /* player location in dungeon */
  16. int16 char_row;
  17. int16 char_col;
  18. /* calculated base hp values for player at each level, store them so that
  19.    drain life + restore life does not affect hit points */
  20. int16u player_hp[MAX_PLAYER_LEVEL];
  21.  
  22. /* Class titles for different levels                */
  23. #ifdef MACGAME
  24. const char *(*player_title)[MAX_PLAYER_LEVEL];
  25. #else
  26. const char *player_title[MAX_CLASS][MAX_PLAYER_LEVEL] = {
  27.     /* Warrior     */
  28. {"Rookie","Private","Soldier","Mercenary","Veteran(1st)","Veteran(2nd)",
  29. "Veteran(3rd)","Warrior(1st)","Warrior(2nd)","Warrior(3rd)","Warrior(4th)",
  30. "Swordsman-1","Swordsman-2","Swordsman-3","Hero","Swashbuckler","Myrmidon",
  31. "Champion-1","Champion-2","Champion-3","Superhero","Knight","Superior Knt",
  32. "Gallant Knt","Knt Errant","Guardian Knt","Baron","Duke","Lord (1st)",
  33. "Lord (2nd)","Lord (3rd)","Lord (4th)","Lord (5th)","Lord (6th)","Lord (7th)",
  34. "Lord (8th)","Lord (9th)","Lord (10th)","Lord (11th)","Lord (12th)",
  35. "Lord (13th)","Lord (14th)","Lord (15th)","Lord (16th)","Lord (17th)",
  36. "Lord (18th)","Lord (19th)","Lord Gallant","Lord Keeper","Lord Noble"},
  37.     /* Mage         */
  38. {"Novice","Apprentice","Trickster-1","Trickster-2","Trickster-3","Cabalist-1",
  39. "Cabalist-2","Cabalist-3","Visionist","Phantasmist","Shadowist","Spellbinder",
  40. "Illusionist","Evoker (1st)","Evoker (2nd)","Evoker (3rd)","Evoker (4th)",
  41. "Conjurer","Theurgist","Thaumaturge","Magician","Enchanter","Warlock",
  42. "Sorcerer","Necromancer","Mage (1st)","Mage (2nd)","Mage (3rd)","Mage (4th)",
  43. "Mage (5th)","Wizard (1st)","Wizard (2nd)","Wizard (3rd)","Wizard (4th)",
  44. "Wizard (5th)","Wizard (6th)","Wizard (7th)","Wizard (8th)","Wizard (9th)",
  45. "Wizard (10th)","Wizard (11th)","Wizard (12th)","Wizard (13th)",
  46. "Wizard (14th)","Wizard (15th)","Wizard (16th)","Wizard (17th)",
  47. "Wizard (18th)","Wizard (19th)","Wizard Lord"},
  48.     /* Priests     */
  49. {"Believer","Acolyte(1st)","Acolyte(2nd)","Acolyte(3rd)","Adept (1st)",
  50. "Adept (2nd)","Adept (3rd)","Priest (1st)","Priest (2nd)","Priest (3rd)",
  51. "Priest (4th)","Priest (5th)","Priest (6th)","Priest (7th)","Priest (8th)",
  52. "Priest (9th)","Curate (1st)","Curate (2nd)","Curate (3rd)","Curate (4th)",
  53. "Curate (5th)","Curate (6th)","Curate (7th)","Curate (8th)","Curate (9th)",
  54. "Canon (1st)","Canon (2nd)","Canon (3rd)","Canon (4th)","Canon (5th)",
  55. "Canon (6th)","Canon (7th)","Canon (8th)","Canon (9th)",
  56. "Low Lama","Lama-1","Lama-2","Lama-3","Lama-4","Lama-5","Lama-6","Lama-7",
  57. "Lama-8","Lama-9","High Lama","Great Lama","Patriarch",
  58. "High Priest","Great Priest","Noble Priest"},
  59.     /* Rogues     */
  60. {"Vagabond","Footpad","Cutpurse","Robber","Burglar","Filcher","Sharper",
  61. "Magsman","Common Rogue","Rogue (1st)","Rogue (2nd)","Rogue (3rd)",
  62. "Rogue (4th)","Rogue (5th)","Rogue (6th)","Rogue (7th)","Rogue (8th)",
  63. "Rogue (9th)","Master Rogue","Expert Rogue","Senior Rogue","Chief Rogue",
  64. "Prime Rogue","Low Thief","Thief (1st)","Thief (2nd)","Thief (3rd)",
  65. "Thief (4th)","Thief (5th)","Thief (6th)","Thief (7th)","Thief (8th)",
  66. "Thief (9th)","Thief (10th)","Thief (11th)","Thief (12th)","Thief (13th)",
  67. "Thief (14th)","Thief (15th)","Thief (16th)","Thief (17th)","Thief (18th)",
  68. "Thief (19th)","High Thief","Master Thief","Executioner","Low Assassin",
  69. "Assassin","High Assassin","Guildsmaster"},
  70.     /* Rangers     */
  71. {"Runner (1st)","Runner (2nd)","Runner (3rd)","Strider (1st)","Strider (2nd)",
  72. "Strider (3rd)","Scout (1st)","Scout (2nd)","Scout (3rd)","Scout (4th)",
  73. "Scout (5th)","Courser (1st)","Courser (2nd)","Courser (3rd)","Courser (4th)",
  74. "Courser (5th)","Tracker (1st)","Tracker (2nd)","Tracker (3rd)",
  75. "Tracker (4th)","Tracker (5th)","Tracker (6th)","Tracker (7th)",
  76. "Tracker (8th)","Tracker (9th)","Guide (1st)","Guide (2nd)","Guide (3rd)",
  77. "Guide (4th)","Guide (5th)","Guide (6th)","Guide (7th)","Guide (8th)",
  78. "Guide (9th)","Guide (10th)","Guide (11th)","Guide (12th)","Guide (13th)",
  79. "Guide (14th)","Guide (15th)",
  80. "Pathfinder-1","Pathfinder-2","Pathfinder-3","Pathfinder-4","Pathfinder-5",
  81. "Pathfinder-6","Pathfinder-7","Ranger","High Ranger","Ranger Lord"},
  82.     /* Paladins     */
  83. {"Gallant","Keeper (1st)","Keeper (2nd)","Keeper (3rd)","Keeper (4th)",
  84. "Keeper (5th)","Keeper (6th)","Keeper (7th)","Keeper (8th)","Keeper (9th)",
  85. "Protector-1","Protector-2","Protector-3","Protector-4","Protector-5",
  86. "Protector-6","Protector-7","Protector-8","Defender-1","Defender-2",
  87. "Defender-3","Defender-4","Defender-5","Defender-6","Defender-7","Defender-8",
  88. "Warder (1st)","Warder (2nd)","Warder (3rd)","Warder (4th)","Warder (5th)",
  89. "Warder (6th)","Warder (7th)","Warder (8th)","Warder (9th)","Warder (10th)",
  90. "Warder (11th)","Warder (12th)","Warder (13th)","Warder (14th)",
  91. "Warder (15th)","Warder (16th)","Warder (17th)","Warder (18th)",
  92. "Warder (19th)","Guardian","Chevalier","Justiciar","Paladin","High Lord"}
  93. };
  94. #endif
  95.  
  96. /* Base experience levels, may be adjusted up for race and/or class*/
  97. int32u player_exp[MAX_PLAYER_LEVEL] = {
  98.       10,      25,    45,     70,      100,        140,      200,    280,
  99.      380,     500,     650,    850,     1100,       1400,     1800,     2300,
  100.     2900,    3600,    4400,    5400,     6800,       8400,    10200,    12500,
  101.    17500,   25000,  35000L,  50000L,   75000L,    100000L,  150000L,  200000L,
  102.  275000L, 350000L, 450000L, 550000L, 700000L, 850000L, 1000000L, 1250000L,
  103. 1500000L, 1800000L, 2100000L, 2400000L, 2700000L, 3000000L, 3500000L, 4000000L,
  104. 4500000L, 5000000L
  105. };
  106.  
  107. /*Race    STR,INT,WIS,DEX,CON,CHR,
  108.     Ages, heights, and weights (male then female)
  109.     Racial Bases for: dis,srh,stl,fos,bth,bthb,bsav,hitdie,
  110.     infra, exp base, choice-classes */
  111. #ifdef MACGAME
  112. race_type *race;
  113. #else
  114. race_type race[MAX_RACES] = {
  115.    {"Human",     0,  0,     0,  0,     0,  0,
  116.       14,  6, 72,  6,180, 25, 66,  4,150, 20,
  117.       0,  0,  0,  0,  0,  0,  0, 10,  0, 100, 0x3F,
  118.     },
  119.    {"Half-Elf", -1,  1,     0,  1, -1,  1,
  120.       24, 16, 66,  6,130, 15, 62,  6,100, 10,
  121.       2,  6,  1, -1, -1,  5,  3,  9,  2, 110, 0x3F,
  122.     },
  123.    {"Elf",    -1,  2,     1,  1, -2,  1,
  124.       75, 75, 60,  4,100,  6, 54,  4, 80,  6,
  125.       5,  8,  1, -2, -5, 15,  6,  8,  3, 120, 0x1F,
  126.     },
  127.    {"Hobbit", -2,  2,     1,  3,     2,  1,
  128.       21, 12, 36,  3, 60,  3, 33,  3, 50,  3,
  129.       15, 12,  4, -5,-10, 20, 18,  7,  4, 110, 0x0B,
  130.     },
  131.    {"Gnome",    -1,  2,     0,  2,     1, -2,
  132.       50, 40, 42,  3, 90,  6, 39,  3, 75,  3,
  133.       10,  6,  3, -3, -8, 12, 12,  8,  4, 125, 0x0F,
  134.     },
  135.    {"Dwarf",     2, -3,     2, -2,     2, -3,
  136.       35, 15, 48,  3,150, 10, 46,  3,120, 10,
  137.       2,  7,  -1,  0, 15,  0,  9,  11,  5, 120, 0x05,
  138.     },
  139.    {"Half-Orc",     2, -1,     0,  0,     1, -4,
  140.       11,  4, 66,  1,150,  5, 62,  1,120,  5,
  141.       -3,  0, -1,  3, 12, -5, -3, 10,  3, 110, 0x0D,
  142.     },
  143.    {"Half-Troll",4, -4, -2, -4,     3, -6,
  144.       20, 10, 96, 10,255, 50, 84,  8,225, 40,
  145.       -5, -1, -2,  5, 20,-10, -8, 12,  3, 120, 0x05,
  146.     },
  147.    {"Dunadan",  1,  2,  2,  2,  3,  2,
  148.       50, 20, 82, 5, 190, 20, 78,  6, 180, 15,
  149.       4,   3,  2, -3, 15, 10,  5, 10,  0, 180, 0x3F,
  150.     },
  151.    {"High-Elf",  1,  3, -1,  3,  1,  5,
  152.      100, 30, 90,10, 190, 20, 82, 10, 180, 15,
  153.       4,   3,  3, -4, 15, 25, 20, 10,  4, 200, 0x1F,
  154.     }
  155.  };
  156. #endif
  157.  
  158. /* 5 char race for printing scores. */
  159. #if 0 /* not used */
  160. const char *dsp_race[MAX_RACES] = {
  161.   "Human",
  162.   "H-Elf",
  163.   "Elf  ",
  164.   "Hobbt",
  165.   "Gnome",
  166.   "Dwarf",
  167.   "H-Orc",
  168.   "H-Tro",
  169.   "Duned",
  170.   "HiElf"
  171. };
  172. #endif
  173. /* Background information                    */
  174. #ifdef MACGAME
  175. background_type *background;
  176. #else
  177. background_type background[MAX_BACKGROUND] = {
  178. {"You are the illegitimate and unacknowledged child ",         10, 1, 2, 25},
  179. {"You are the illegitimate but acknowledged child ",         20, 1, 2, 35},
  180. {"You are one of several children ",                 95, 1, 2, 45},
  181. {"You are the first child ",                    100, 1, 2, 50},
  182.  
  183. {"of a Serf.  ",                         40, 2, 3, 65},
  184. {"of a Yeoman.  ",                         65, 2, 3, 80},
  185. {"of a Townsman.  ",                         80, 2, 3, 90},
  186. {"of a Guildsman.  ",                         90, 2, 3,105},
  187. {"of a Landed Knight.  ",                     96, 2, 3,120},
  188. {"of a Titled Noble.  ",                     99, 2, 3,130},
  189. {"of a Royal Blood Line.  ",                    100, 2, 3,140},
  190.  
  191. {"You are the black sheep of the family.  ",             20, 3,50, 20},
  192. {"You are a credit to the family.  ",                 80, 3,50, 55},
  193. {"You are a well liked child.  ",                100, 3,50, 60},
  194.  
  195. {"Your mother was of the Teleri.  ",                 40, 4, 1, 50},
  196. {"Your father was of the Teleri.  ",                 75, 4, 1, 55},
  197. {"Your mother was of the Noldor.  ",                  90, 4, 1, 55},
  198. {"Your father was of the Noldor.  ",                  95, 4, 1, 60},
  199. {"Your mother was of the Vanyar.  ",                 98, 4, 1, 65},
  200. {"Your father was of the Vanyar.  ",                100, 4, 1, 70},
  201.  
  202. {"You are one of several children ",                 60, 7, 8, 50},
  203. {"You are the only child ",                    100, 7, 8, 55},
  204.  
  205. {"of a Teleri ",                         75, 8, 9, 50},
  206. {"of a Noldor ",                         95, 8, 9, 55},
  207. {"of a Vanyar ",                        100, 8, 9, 60},
  208.  
  209. {"Ranger.  ",                             40, 9,54, 80},
  210. {"Archer.  ",                             70, 9,54, 90},
  211. {"Warrior.  ",                             87, 9,54,110},
  212. {"Mage.  ",                             95, 9,54,125},
  213. {"Prince.  ",                             99, 9,54,140},
  214. {"King.  ",                            100, 9,54,145},
  215.  
  216. {"You are one of several children of a Hobbit ",         85,10,11, 45},
  217. {"You are the only child of a Hobbit ",                    100,10,11, 55},
  218.  
  219. {"Bum.  ",                             20,11, 3, 55},
  220. {"Tavern Owner.  ",                         30,11, 3, 80},
  221. {"Miller.  ",                             40,11, 3, 90},
  222. {"Home Owner.  ",                         50,11, 3,100},
  223. {"Burglar.  ",                             80,11, 3,110},
  224. {"Warrior.  ",                             95,11, 3,115},
  225. {"Mage.  ",                             99,11, 3,125},
  226. {"Clan Elder.  ",                        100,11, 3,140},
  227.  
  228. {"You are one of several children of a Gnome ",             85,13,14, 45},
  229. {"You are the only child of a Gnome ",                100,13,14, 55},
  230.  
  231. {"Beggar.  ",                             20,14, 3, 55},
  232. {"Braggart.  ",                             50,14, 3, 70},
  233. {"Prankster.  ",                         75,14, 3, 85},
  234. {"Warrior.  ",                             95,14, 3,100},
  235. {"Mage.  ",                            100,14, 3,125},
  236.  
  237. {"You are one of two children of a Dwarven ",             25,16,17, 40},
  238. {"You are the only child of a Dwarven ",            100,16,17, 50},
  239.  
  240. {"Thief.  ",                             10,17,18, 60},
  241. {"Prison Guard.  ",                         25,17,18, 75},
  242. {"Miner.  ",                             75,17,18, 90},
  243. {"Warrior.  ",                             90,17,18,110},
  244. {"Priest.  ",                             99,17,18,130},
  245. {"King.  ",                            100,17,18,150},
  246.  
  247. {"You are the black sheep of the family.  ",             15,18,57, 10},
  248. {"You are a credit to the family.  ",                 85,18,57, 50},
  249. {"You are a well liked child.  ",                100,18,57, 55},
  250.  
  251. {"Your mother was an Orc, but it is unacknowledged.  ",         25,19,20, 25},
  252. {"Your father was an Orc, but it is unacknowledged.  ",        100,19,20, 25},
  253.  
  254. {"You are the adopted child ",                    100,20, 2, 50},
  255.  
  256. {"Your mother was a Cave-Troll ",                 30,22,23, 20},
  257. {"Your father was a Cave-Troll ",                 60,22,23, 25},
  258. {"Your mother was a Hill-Troll ",                 75,22,23, 30},
  259. {"Your father was a Hill-Troll ",                 90,22,23, 35},
  260. {"Your mother was a Water-Troll ",                 95,22,23, 40},
  261. {"Your father was a Water-Troll ",                100,22,23, 45},
  262.  
  263. {"Cook.  ",                              5,23,62, 60},
  264. {"Warrior.  ",                             95,23,62, 55},
  265. {"Shaman.  ",                             99,23,62, 65},
  266. {"Clan Chief.  ",                        100,23,62, 80},
  267.  
  268. {"You have dark brown eyes, ",                     20,50,51, 50},
  269. {"You have brown eyes, ",                     60,50,51, 50},
  270. {"You have hazel eyes, ",                     70,50,51, 50},
  271. {"You have green eyes, ",                     80,50,51, 50},
  272. {"You have blue eyes, ",                     90,50,51, 50},
  273. {"You have blue-gray eyes, ",                    100,50,51, 50},
  274.  
  275. {"straight ",                             70,51,52, 50},
  276. {"wavy ",                             90,51,52, 50},
  277. {"curly ",                            100,51,52, 50},
  278.  
  279. {"black hair, ",                         30,52,53, 50},
  280. {"brown hair, ",                         70,52,53, 50},
  281. {"auburn hair, ",                         80,52,53, 50},
  282. {"red hair, ",                             90,52,53, 50},
  283. {"blond hair, ",                        100,52,53, 50},
  284.  
  285. {"and a very dark complexion.",                     10,53, 0, 50},
  286. {"and a dark complexion.",                     30,53, 0, 50},
  287. {"and an average complexion.",                     80,53, 0, 50},
  288. {"and a fair complexion.",                     90,53, 0, 50},
  289. {"and a very fair complexion.",                    100,53, 0, 50},
  290.  
  291. {"You have light grey eyes, ",                     85,54,55, 50},
  292. {"You have light blue eyes, ",                     95,54,55, 50},
  293. {"You have light green eyes, ",                    100,54,55, 50},
  294.  
  295. {"straight ",                             75,55,56, 50},
  296. {"wavy ",                            100,55,56, 50},
  297.  
  298. {"black hair, and a fair complexion.",                 75,56, 0, 50},
  299. {"brown hair, and a fair complexion.",                 85,56, 0, 50},
  300. {"blond hair, and a fair complexion.",                 95,56, 0, 50},
  301. {"silver hair, and a fair complexion.",                100,56, 0, 50},
  302.  
  303. {"You have dark brown eyes, ",                     99,57,58, 50},
  304. {"You have glowing red eyes, ",                    100,57,58, 60},
  305.  
  306. {"straight ",                             90,58,59, 50},
  307. {"wavy ",                            100,58,59, 50},
  308.  
  309. {"black hair, ",                         75,59,60, 50},
  310. {"brown hair, ",                        100,59,60, 50},
  311.  
  312. {"a one foot beard, ",                         25,60,61, 50},
  313. {"a two foot beard, ",                         60,60,61, 51},
  314. {"a three foot beard, ",                     90,60,61, 53},
  315. {"a four foot beard, ",                        100,60,61, 55},
  316.  
  317. {"and a dark complexion.",                    100,61, 0, 50},
  318.  
  319. {"You have slime green eyes, ",                     60,62,63, 50},
  320. {"You have puke yellow eyes, ",                     85,62,63, 50},
  321. {"You have blue-bloodshot eyes, ",                 99,62,63, 50},
  322. {"You have glowing red eyes, ",                    100,62,63, 55},
  323.  
  324. {"dirty ",                             33,63,64, 50},
  325. {"mangy ",                             66,63,64, 50},
  326. {"oily ",                            100,63,64, 50},
  327.  
  328. {"sea-weed green hair, ",                     33,64,65, 50},
  329. {"bright red hair, ",                         66,64,65, 50},
  330. {"dark purple hair, ",                        100,64,65, 50},
  331.  
  332. {"and green ",                             25,65,66, 50},
  333. {"and blue ",                             50,65,66, 50},
  334. {"and white ",                             75,65,66, 50},
  335. {"and black ",                            100,65,66, 50},
  336.  
  337. {"ulcerous skin.",                         33,66, 0, 50},
  338. {"scabby skin.",                         66,66, 0, 50},
  339. {"leprous skin.",                        100,66, 0, 50}
  340. };
  341. #endif
  342.  
  343. /* Classes.                            */
  344. class_type class[MAX_CLASS] = {
  345. /*      HP Dis Src Stl Fos bth btb sve S  I  W  D Co Ch  Spell Exp  spl */
  346. {"Warrior",9, 25, 14, 1, 38, 70, 55, 18, 5,-2,-2, 2, 2,-1, NONE,    0, 0},
  347. {"Mage",   0, 30, 16, 2, 20, 34, 20, 36,-5, 3, 0, 1,-2, 1, MAGE,   30, 1},
  348. {"Priest", 2, 25, 16, 2, 32, 48, 35, 30,-1,-3, 3,-1, 0, 2, PRIEST, 20, 1},
  349. {"Rogue",  6, 45, 32, 5, 16, 60, 66, 30, 2, 1,-2, 3, 1,-1, MAGE,   25, 5},
  350. {"Ranger", 4, 30, 24, 3, 24, 56, 72, 30, 2, 2, 0, 1, 1, 1, MAGE,   30, 3},
  351. {"Paladin",6, 20, 12, 1, 38, 68, 40, 24, 3,-3, 1, 0, 2, 2, PRIEST, 35, 1}
  352. };
  353.  
  354. /* making it 16 bits wastes a little space, but saves much signed/unsigned
  355.    headaches in its use */
  356. /* CLA_MISC_HIT is identical to CLA_SAVE, which takes advantage of
  357.    the fact that the save values are independent of the class */
  358. int16 class_level_adj[MAX_CLASS][MAX_LEV_ADJ] = {
  359. /*           bth    bthb   device  disarm   save/misc hit  */
  360. /* Warrior */ {    4,    4,    2,    2,    3 },
  361. /* Mage    */ { 2,    2,    4,    2,    3 },
  362. /* Priest  */ { 2,    2,    4,    3,    3 },
  363. /* Rogue   */ { 3,    4,    3,    4,    3 },
  364. /* Ranger  */ { 3,    4,    3,    3,    3 },
  365. /* Paladin */ { 3,    2,    3,    2,    3 }
  366. };
  367.  
  368. int32u spell_learned = 0;    /* bit mask of spells learned */
  369. int32u spell_learned2 = 0;    /* bit mask of spells learned */
  370. int32u spell_worked = 0;    /* bit mask of spells tried and worked */
  371. int32u spell_worked2 = 0;    /* bit mask of spells tried and worked */
  372. int32u spell_forgotten = 0;    /* bit mask of spells learned but forgotten */
  373. int32u spell_forgotten2 = 0;    /* bit mask of spells learned but forgotten */
  374. int8u spell_order[64];        /* order spells learned/remembered/forgotten */
  375.  
  376. /* Warriors don't have spells, so there is no entry for them.  Note that
  377.    this means you must always subtract one from the py.misc.pclass before
  378.    indexing into magic_spell[]. */
  379. #ifdef MACGAME
  380. spell_type (*magic_spell)[63];
  381. #else
  382. spell_type magic_spell[MAX_CLASS-1][63] = {
  383.   {          /* Mage       */
  384. /* Beginners Magic */
  385.      {    1,  1, 22,   1},
  386.      {    1,  1, 23,   1},
  387.      {    1,  2, 24,   1},
  388.      {    1,  2, 26,   1},
  389.      { 99, 99,  0,   0},
  390.      {    3,  3, 25,   2},
  391.      { 99, 99,  0,   0},
  392.      {    3,  3, 25,   1},
  393.      {    3,  3, 27,   2},
  394. /* Conjuring and Tricks */
  395.      {    3,  4, 30,   1},
  396.      {    5,  4, 30,   6},
  397.      {    5,  5, 30,   8},
  398.      {    5,  5, 30,   5},
  399.      {    5,  5, 35,   6},
  400.      {    7,  6, 35,   9},
  401.      {    7,  6, 30,  10},
  402.      {    7,  6, 40,  12},
  403.      {    9,  7, 44,  19},
  404. /* Incantations and Illusions */
  405.      {    9,  7, 45,  19},
  406.      {    9,  7, 75,  22},
  407.      {    9,  7, 45,  19},
  408.      { 11,  7, 45,  25},
  409.      { 11,  7, 75,  19},
  410.      { 13,  7, 50,  22},
  411.      { 15,  9, 50,  25},
  412.      { 17,  9, 50,  31},
  413. /* Sorcery and Evocoations */
  414.      { 19, 12, 55,  38},
  415.      { 21, 12, 90,  44},
  416.      { 23, 12, 60,  50},
  417.      { 25, 12, 65,  63},
  418.      { 29, 18, 65,  88},
  419.      { 33, 21, 80, 125},
  420.      { 37, 25, 95, 200},
  421.  
  422.      { 7,   7, 20,  50},
  423.      { 9,  12, 40, 100},
  424.      { 15, 17, 60, 110},
  425.      { 20, 18, 60, 120},
  426.      { 25, 25, 75, 120},
  427.  
  428.      { 10, 6,  50,  30},
  429.      { 12, 9,  60,  50},
  430.      { 20, 15, 70, 100},
  431.      { 27, 25, 75, 200},
  432.      { 35, 35, 85, 300},
  433.      { 42, 45, 95,2000},
  434.  
  435.      { 5,  5,  50,  10},
  436.      { 10, 10, 70,  100},
  437.      { 25, 30, 95, 1000},
  438.      { 30, 50, 70,  300},
  439.      { 40, 50, 80, 1000},
  440.  
  441.      { 4, 5,  50,   100},
  442.      { 4, 5,  50,   100},
  443.      { 4, 5,  50,   100},
  444.      { 8, 10, 75,   200},
  445.      { 15, 20,  85, 1000},
  446.  
  447.      { 5, 5,  50,   100},
  448.      { 10, 12, 75,  300},
  449.      { 15, 20, 80,  800},
  450.      { 22, 30, 50, 2000},
  451.      { 45, 70, 75, 5000},
  452.  
  453.      { 99, 99,  0,   0},
  454.      { 99, 99,  0,   0},
  455.      { 99, 99,  0,   0},
  456.      { 99, 99,  0,   0}
  457.    },
  458.    {          /* Priest       */
  459.      {    1,  1, 10,   1},
  460.      {    1,  2, 15,   1},
  461.      {    1,  2, 20,   1},
  462.      {    1,  2, 25,   1},
  463.      {    3,  2, 25,   1},
  464.      {    3,  3, 27,   2},
  465.      {    3,  3, 27,   2},
  466.      {    3,  3, 28,   3},
  467.  
  468.      {    5,  4, 29,   4},
  469.      {    5,  4, 30,   5},
  470.      {    5,  4, 32,   5},
  471.      {    5,  5, 34,   5},
  472.      {    7,  5, 36,   6},
  473.      {    7,  5, 38,   7},
  474.      {    7,  6, 38,   9},
  475.      {    7,  7, 38,   9},
  476.  
  477.      {    9,  6, 38,  10},
  478.      {    9,  7, 38,  10},
  479.      {    9,  7, 40,  10},
  480.      { 11,  8, 42,  10},
  481.      { 11,  8, 42,  12},
  482.      { 11,  9, 55,  15},
  483.      { 13, 10, 45,  15},
  484.      { 13, 11, 45,  16},
  485.      { 15, 12, 50,  20},
  486.      { 15, 14, 50,  22},
  487.      { 17, 14, 55,  32},
  488.      { 21, 16, 60,  38},
  489.      { 25, 20, 70,  75},
  490.      { 33, 55, 90, 125},
  491.      { 39, 32, 95, 200},
  492.  
  493.      { 3,  3,  50,   2},
  494.      { 10, 10, 80,   50},
  495.      { 20, 20, 80,   100},
  496.      { 25, 10, 80,  1000},
  497.      { 35, 50, 80,  2000},
  498.  
  499.      { 15,  5, 50,   100},
  500.      { 17,  7, 60,   200},
  501.      { 30, 50, 80,  1000},
  502.      { 35, 70, 90,  2000},
  503.      { 35, 70, 90,  3000},
  504.  
  505.      { 15, 7,  70,  100},
  506.      { 20, 10, 75,  300},
  507.      { 25, 25, 80,  1500},
  508.      { 35, 35, 80,  1000},
  509.      { 45, 60, 75,  4000},
  510.  
  511.      { 5, 6,  50,   50},
  512.      { 15, 20, 80,  100},
  513.      { 25, 40, 80,  1000},
  514.      { 35, 50, 80,  2000},
  515.      { 37, 60, 85,  3000},
  516.      { 45, 95, 85,  6000},
  517.  
  518.      { 3, 3,  50,   5},
  519.      { 10, 10,  50,  20},
  520.      { 20, 20,  80,  80},
  521.      { 30, 40,  75, 1000},
  522.      { 35, 50,  75, 100},
  523.      { 40, 60,  75, 3000},
  524.  
  525.      { 99, 99,  0,   0},
  526.      { 99, 99,  0,   0},
  527.      { 99, 99,  0,   0},
  528.      { 99, 99,  0,   0},
  529.      { 99, 99,  0,   0}
  530.    },
  531.    {          /* Rogue       */
  532.      { 99, 99,    0,   0},
  533.      {    5,  1, 50,   1},
  534.      {    7,  2, 55,   1},
  535.      {    9,  3, 60,   2},
  536.      { 10,  3, 60,   2},
  537.      { 11,  4, 65,   2},
  538.      { 12,  4, 65,   3},
  539.      { 13,  5, 70,   3},
  540.      { 99, 99,    0,   0},
  541.  
  542.      { 15,  6, 75,   3},
  543.      { 99, 99,    0,   0},
  544.      { 17,  7, 80,   4},
  545.      { 19,  8, 85,   5},
  546.      { 21,  9, 90,   6},
  547.      { 22,  9, 50,   7},
  548.      { 23, 10, 95,   7},
  549.      { 99, 99,    0,   0},
  550.      { 24, 11, 70,  10},
  551.  
  552.      { 25, 12, 95,  11},
  553.      { 27, 15, 99,  12},
  554.      { 99, 99,    0,   0},
  555.      { 99, 99,    0,   0},
  556.      { 28, 18, 50,  19},
  557.      { 99, 99,    0,   0},
  558.      { 99, 99,    0,   0},
  559.      { 99, 99,    0,   0},
  560.  
  561.      { 99, 99,    0,   0},
  562.      { 99, 99,    0,   0},
  563.      { 99, 99,    0,   0},
  564.      { 32, 25, 70,  50},
  565.      { 99, 99,    0,   0},
  566.      { 99, 99,    0,   0},
  567.      { 99, 99,    0,   0},
  568.  
  569.      { 7,   7, 20,  50},
  570.      { 9,  12, 40, 100},
  571.      { 15, 17, 60, 110},
  572.      { 99, 99,    0,   0},
  573.      { 30, 35, 75, 120},
  574.  
  575.      { 13, 16,  50,  30},
  576.      { 18, 20,  60,  50},
  577.      { 99, 99,    0,   0},
  578.      { 99, 99,    0,   0},
  579.      { 99, 99,    0,   0},
  580.      { 99, 99,    0,   0},
  581.  
  582.      { 5,  5,  50,  10},
  583.      { 10, 10, 70,  100},
  584.      { 35, 40, 95, 1000},
  585.      { 99, 99,    0,   0},
  586.      { 99, 99,    0,   0},
  587.  
  588.      { 10, 12,  50,   100},
  589.      { 10, 12,  50,   100},
  590.      { 10, 12,  50,   100},
  591.      { 15, 20,  75,   200},
  592.      { 25, 30,  85,  1000},
  593.  
  594.      { 10, 11,  50,   100},
  595.      { 15, 20, 75,  300},
  596.      { 20, 25, 80,  800},
  597.      { 26, 30, 50, 2000},
  598.      { 99, 99,  0,   0},
  599.  
  600.      { 99, 99,  0,   0},
  601.      { 99, 99,  0,   0},
  602.      { 99, 99,  0,   0},
  603.      { 99, 99,  0,   0}
  604.    },
  605.    {           /* Ranger        */
  606.      {    3,  1, 30,   1},
  607.      {    3,  2, 35,   2},
  608.      {    3,  2, 35,   2},
  609.      {    5,  3, 35,   2},
  610.      { 99, 99,  0,   0},
  611.      {    5,  3, 40,   2},
  612.      { 99, 99,  0,   0},
  613.      {    5,  4, 45,   3},
  614.      {    7,  5, 40,   6},
  615.      {    7,  6, 40,   5},
  616.      {    9,  7, 40,   7},
  617.      {    9,  8, 45,   8},
  618.      { 11,  8, 40,  10},
  619.      { 11,  9, 45,  10},
  620.      { 13, 10, 45,  12},
  621.      { 13, 11, 55,  13},
  622.      { 15, 12, 50,  15},
  623.      { 15, 13, 50,  15},
  624.      { 17, 17, 55,  15},
  625.      { 17, 17, 90,  17},
  626.      { 21, 17, 55,  17},
  627.      { 21, 19, 60,  18},
  628.      { 23, 25, 90,  20},
  629.      { 23, 20, 60,  20},
  630.      { 25, 20, 60,  20},
  631.      { 25, 21, 65,  20},
  632.      { 27, 21, 65,  22},
  633.      { 29, 23, 95,  23},
  634.      { 31, 25, 70,  25},
  635.      { 33, 25, 75,  38},
  636.      { 35, 25, 80,  50},
  637.      { 37, 30, 95, 100},
  638.      { 99, 99,    0,   0},
  639.  
  640.      { 8,  17, 20,  50},
  641.      { 19,  22, 40, 100},
  642.      { 25, 27, 60, 110},
  643.      { 30, 28, 60, 120},
  644.      { 35, 35, 75, 120},
  645.  
  646.      { 20, 16,  50,  30},
  647.      { 22, 19,  60,  50},
  648.      { 30, 25, 70, 100},
  649.      { 37, 35, 75, 200},
  650.      { 35, 45, 85, 300},
  651.      { 99, 99, 0,    0},
  652.  
  653.      { 10,  15,  50,  10},
  654.      { 15, 20, 70,  100},
  655.      { 35, 60, 95, 1000},
  656.      { 99, 99, 0,    0},
  657.      { 99, 99, 0,    0},
  658.  
  659.      { 8, 15,  50,   100},
  660.      { 8, 15,  50,   100},
  661.      { 8, 15,  50,   100},
  662.      { 16, 25, 75,   200},
  663.      { 25, 40,  85, 1000},
  664.  
  665.      { 10, 15,  50,   100},
  666.      { 15, 20, 75,  300},
  667.      { 25, 30, 80,  800},
  668.      { 32, 50, 50, 2000},
  669.      { 99, 99,  0,   0},
  670.  
  671.      { 99, 99,  0,   0},
  672.      { 99, 99,  0,   0},
  673.      { 99, 99,  0,   0},
  674.      { 99, 99,  0,   0}
  675.    },
  676.    {          /* Paladin       */
  677.      {    1,  1, 30,   1},
  678.      {    2,  2, 35,   2},
  679.      {    3,  3, 35,   3},
  680.      {    5,  3, 35,   5},
  681.      {    5,  4, 35,   5},
  682.      {    7,  5, 40,   6},
  683.      {    7,  5, 40,   6},
  684.      {    9,  7, 40,   7},
  685.      {    9,  7, 40,   8},
  686.      {    9,  8, 40,   8},
  687.      { 11,  9, 40,  10},
  688.      { 11, 10, 45,  10},
  689.      { 11, 10, 45,  10},
  690.      { 13, 10, 45,  12},
  691.      { 13, 11, 45,  13},
  692.      { 15, 13, 45,  15},
  693.      { 15, 15, 50,  15},
  694.      { 17, 15, 50,  17},
  695.      { 17, 15, 50,  18},
  696.      { 19, 15, 50,  19},
  697.      { 19, 15, 50,  19},
  698.      { 21, 17, 50,  20},
  699.      { 23, 17, 50,  20},
  700.      { 25, 20, 50,  20},
  701.      { 27, 21, 50,  22},
  702.      { 29, 22, 50,  24},
  703.      { 31, 24, 60,  25},
  704.      { 33, 28, 60,  31},
  705.      { 35, 32, 70,  38},
  706.      { 37, 70, 90,  50},
  707.      { 39, 38, 95, 100},
  708.  
  709.      { 5,  5,  50,   2},
  710.      { 15, 15, 80,   50},
  711.      { 25, 25, 80,   100},
  712.      { 30, 15, 80,  1000},
  713.      { 37, 55, 80,  2000},
  714.  
  715.      { 17,  15, 50,   100},
  716.      { 23,  25, 60,   200},
  717.      { 35, 60, 80,  1000},
  718.      { 40, 80, 90,  2000},
  719.      { 40, 80, 90,  3000},
  720.  
  721.      { 20, 13,  70,  100},
  722.      { 30, 20, 75,  300},
  723.      { 30, 35, 80,  1500},
  724.      { 40, 40, 80,  1000},
  725.      { 47, 70, 75,  4000},
  726.  
  727.      { 10, 16,  50,   50},
  728.      { 25, 30, 80,  100},
  729.      { 30, 50, 80,  1000},
  730.      { 40, 70, 80,  2000},
  731.      { 42, 80, 85,  3000},
  732.      { 47, 95, 85,  6000},
  733.  
  734.      { 7, 7,  50,   5},
  735.      { 20, 20,  50,  20},
  736.      { 25, 25,  80,  80},
  737.      { 35, 50,  75, 1000},
  738.      { 40, 60,  75, 100},
  739.      { 45, 70,  75, 3000},
  740.  
  741.      { 99, 99,  0,   0},
  742.      { 99, 99,  0,   0},
  743.      { 99, 99,  0,   0},
  744.      { 99, 99,  0,   0},
  745.      { 99, 99,  0,   0}
  746.    }
  747.  };
  748. #endif
  749.  
  750. const char *spell_names[127] = {
  751.   /* Mage Spells */
  752.   "Magic Missile",  "Detect Monsters",    "Phase Door",  "Light Area",
  753.   "Treasure Detection",
  754.   "Cure Light Wounds",      "Object Detection",
  755.   "Find Hidden Traps/Doors",  "Stinking Cloud",
  756.   "Confusion",    "Lightning Bolt",  "Trap/Door Destruction", "Sleep I",
  757.   "Cure Poison",  "Teleport Self",  "Spear of Light",  "Frost Bolt",
  758. #ifdef SATISFY_HUNGER
  759.   "Turn Stone to Mud",    "Staisfy Hunger",    "Recharge Item I",  "Sleep II",
  760. #else
  761.   "Turn Stone to Mud",    "Create Food",    "Recharge Item I",  "Sleep II",
  762. #endif
  763.   "Polymorph Other",  "Identify",  "Sleep III",     "Fire Bolt",  "Slow Monster",
  764.   "Frost Ball",     "Recharge Item II", "Teleport Other",    "Haste Self",
  765.   "Fire Ball", "Word of Destruction", "Genocide",
  766.  
  767. /* Mordenkainen's Escapes */
  768.   "Door Creation",
  769.   "Stair Creation",
  770.   "Teleport Level",
  771.   "Earthquake",
  772.   "Word of Recall",
  773.  
  774. /* Raal's Tome of Destruction */
  775.   "Acid Bolt",
  776.   "Cloud Kill",
  777.   "Acid Ball",
  778.   "Ice Storm",
  779.   "Meteor Swarm",
  780.   "Hellfire",
  781.  
  782. /*Kelek's Grimoire of Power*/
  783.   "Detect Evil",
  784.   "Detect Enchantment",
  785.   "Recharge Item III",
  786.   "Genocide",
  787.   "Mass Genocide",
  788.  
  789. /* Resistance of Scarabtarices */
  790.   "Resist Fire",
  791.   "Resist Cold",
  792.   "Resist Acid",
  793.   "Resist Poison",
  794.   "Resistance",
  795.  
  796. /* tenser's transformations...*/
  797.   "Heroism",
  798.   "Shield",
  799.   "Berserker",
  800.   "Essence of Speed",
  801.   "Globe of Invulnerability",
  802.  
  803.   "blank",
  804.   "blank",
  805.   "blank",
  806.   "blank",
  807.   /* Priest Spells, start at index 31 now 63 ~Ludwig */
  808.   "Detect Evil",  "Cure Light Wounds",    "Bless",  "Remove Fear", "Call Light",
  809.   "Find Traps",     "Detect Doors/Stairs",     "Slow Poison",     "Blind Creature",
  810. #ifdef SATISFY_HUNGER
  811.   "Portal",  "Cure Medium Wounds",  "Chant",  "Sanctuary",  "Satisfy Hunger",
  812. #else
  813.   "Portal",  "Cure Medium Wounds",  "Chant",  "Sanctuary",  "Create Food",
  814. #endif
  815.   "Remove Curse",  "Resist Heat and Cold",  "Neutralize Poison",
  816.   "Orb of Draining",  "Cure Serious Wounds",  "Sense Invisible",
  817.   "Protection from Evil",  "Earthquake",  "Sense Surroundings",
  818.   "Cure Critical Wounds",  "Turn Undead",  "Prayer",  "Dispel Undead",
  819.   "Heal",  "Dispel Evil",  "Glyph of Warding",    "Holy Word",
  820.  
  821. /* Godly Insights... */
  822.   "Detect Monsters",
  823.   "Detection",
  824.   "Perception",
  825.   "Probing",
  826.   "Clairvoyance",
  827.  
  828. /* Purifications and Healing */
  829.   "Cure Serious Wounds",
  830.   "Cure Critical Wounds",
  831.   "Healing",
  832.   "Restoration",
  833.   "Remembrance",
  834.  
  835. /* Wrath of God */
  836.   "Dispel Undead",
  837.   "Dispel Evil",
  838.   "Banishment",
  839.   "Word of Destruction",
  840.   "Annihilation",
  841.  
  842. /* Holy Infusions */
  843.   "Unbarring Ways",
  844.   "Recharging",
  845.   "Dispel Curse",
  846.   "Enchant Weapon",
  847.   "Enchant Armour",
  848.   "Elemental Brand",
  849.  
  850. /* Ethereal openings */
  851.   "Blink",
  852.   "Teleport",
  853.   "Teleport Away",
  854.   "Teleport Level",
  855.   "Word of Recall",
  856.   "Alter Reality",
  857.  
  858.   "blank",
  859.   "blank",
  860.   "blank",
  861.   "blank",
  862.   "blank"
  863. };
  864.  
  865. #define MDO MAX_DUNGEON_OBJ
  866. /* Each type of character starts out with a few provisions.    */
  867. /* Note that the entries refer to elements of the object_list[] array*/
  868. /* 356 = Food Ration, 365 = Wooden Torch, 123 = Cloak, 30 = Stiletto,
  869.    103 = Soft Leather Armor, 318 = Beginners-Magic, 322 = Beginners Handbook */
  870.  
  871. int16u player_init[MAX_CLASS][5] = {
  872.         { MDO, MDO+21,  34, 109, 258},    /* Warrior     */
  873.         { MDO, MDO+21,  29, 330, 220},    /* Mage         */
  874.         { MDO, MDO+21,  53, 334, 242},    /* Priest     */
  875.         { MDO, MDO+21,  46, 103, 330},    /* Rogue     */
  876.         { MDO, MDO+21,  34, 330,  74},    /* Ranger     */
  877.         { MDO, MDO+21,  34, 334, 209}    /* Paladin     */
  878.         /* Last array object added for one extra useful object per class */
  879. };
  880.  
  881. /* spellmasks[][] is used to control the "you seem to be missing a book"
  882.     messages, because they cause a little confusion, and a bit of
  883.     irritation.  -CFT */
  884. int32u spellmasks[MAX_CLASS][2] = {
  885.     { 0x0L, 0x0L },            /* warrior */
  886.     { 0xffffffafL, 0x0fffffffL },    /* mage */
  887.     { 0xffffffffL, 0x03ffffffL },    /* priest */
  888.     { 0x284efafeL, 0x03fe70eeL },    /* rogue */
  889.     { 0xffffffafL, 0x03fe77feL },    /* ranger */
  890.     { 0xffffffffL, 0x03ffefffL }    /* paladin */
  891. };
  892.